client
	verb
		testImage()
			set hidden = 1
			var/image = winget(src,"Main_Settings.image","text")
			winset(src,"Main_Settings.imageView","image=\"[image]\";image-mode=stretch")


		Message()
			set hidden = 1
			var/target = winget(src,"Profile_View","title")
			if(!findTarget(target)) return
			if(src.key!=target) Create_IM(src.key, target)

		GiveGift()
			set hidden = 1
			var/target = winget(src,"Profile_View","title")
			if(!findTarget(target)) return
			var/amount = 0
			if(winget(src,"Profile_View.btn1","is-checked") == "true") amount = 100
			if(winget(src,"Profile_View.btn2","is-checked") == "true") amount = 500
			if(winget(src,"Profile_View.btn3","is-checked") == "true") amount = 1000
			if(winget(src,"Profile_View.btn4","is-checked") == "true") amount = 2000
			src.Give(target,amount)

client
	proc
		getImage(text)
			var/image = "http://www.byond.com/member_icons/[copytext(text, 1, 2)]/[copytext(text, 2, 3)]/[text]/images/large_icon.jpg"
			return image



		loadProfile(client/C)
			winset(src,"Profile_View","is-visible=true;pos=[WINDOW_LOCATION]")
			if(!C) return
			winset(src,"Profile_View","title=\"[C.key]\"")
			winset(src,"Profile_View.name","text=\"  [C.User_Name]\"")
			winset(src,"Profile_View.gender","text=\"  [C.User_Gender]\"")
			winset(src,"Profile_View.age","text=\"  [C.User_Age]\"")

			winset(src,"Profile_View.image","image=\"\"; image-mode=stretch")
			spawn(1) winset(src,"Profile_View.image","image=\"[C.User_Image]\"; image-mode=stretch")


			winset(src,"Profile_View.location","text=\"  [C.User_Location]\"")

			winset(src,"Profile_View.contact","text=\"  [C.User_Contact]\"")
			if(C.User_Messenger) winset(src,"Profile_View.messenger","text=\"[C.User_Messenger]:\"")
			else winset(src,"Profile_View.messenger","text=\"Contact:\"")

			winset(src,"Profile_View.status","text=\"[C.Status_Type]\";background-color=[C.Status_Color]")
			winset(src,"Profile_View.message","text=\"[C.Status_Message]\"")
			winset(src,"Profile_View.credits","text=\" $[C.Credits/100]\"")
			winset(src,"Profile_View.game","text=\" [C.Game]\"")

		updateProfiles()
			for(var/client/C in Everyone)
				if(winexists(C,"Profile_View"))
					if(winget(C,"Profile_View","is-visible") == "true" && winget(C,"Profile_View","title") == src.key)
						C.loadProfile(src)